drivers/char: mark DMA buffers as reserved for the XHCI
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Mon, 26 Sep 2022 09:11:33 +0000 (11:11 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 26 Sep 2022 09:11:33 +0000 (11:11 +0200)
commit3a1a7b809ffa4251a9673858a75b161c49c6c241
tree43a8956372025c50650f04bd80ddb5ace14a7d6d
parent3fd9456f2daecaaa0026c51ac2b627dd771cc81a
drivers/char: mark DMA buffers as reserved for the XHCI

The important part is to include those buffers in IOMMU page table
relevant for the USB controller. Otherwise, DbC will stop working as
soon as IOMMU is enabled, regardless of to which domain device assigned
(be it xen or dom0).
If the device is passed through to dom0 or other domain (see later
patches), that domain will effectively have access to those buffers too.
It does give such domain yet another way to DoS the system (as is the
case when having PCI device assigned already), but also possibly steal
the console ring content. Thus, such domain should be a trusted one.
In any case, prevent anything else being placed on those pages by adding
artificial padding.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/char/xhci-dbc.c